<script type="text/javascript" charset="utf-8">
	function toggleLayer( whichLayer, show )
	{
	  var elem, vis;
	  if( 	document.getElementById ) // this is the way the standards work
	    elem = document.getElementById( whichLayer );
	  else if( document.all ) // this is the way old msie versions work
	      elem = document.all[whichLayer];
	  else if( document.layers ) // this is the way nn4 works
	    elem = document.layers[whichLayer];
	  vis = elem.style;
		if (show) {
			vis.display = 'block';
		} else {
			vis.display = 'none';
		}
	}
</script>
<div id="add_form" class="largebloc2">
<h2><?php echo __('addition_ticket'); ?></h2>
<p><?php echo __('the').$time->nice(date("Y-m-d H:i:s")); ?> <?php echo ' '.__('by').' '.$user['firstname'] . ' ' . $user['lastname']; ?></p>
	<form action="add" method="post">

<?php echo $form->hidden('Ticket.project_id', array ('value' => $project_id)); ?>
<?php echo $form->hidden('Ticket.id', array('value' => $ticket_id)); ?>
<?php echo $form->hidden('Ticket.user_id', array ('value'=> $user['id'])); ?>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
  <tr class="odd3">
    <td width="20%"><?php echo $form->label(__('name', true)); ?></td>
    <td><?php echo $form->error('Ticket.name', 'Please supply a name for this ticket.');?>
		<?php echo $form->input('Ticket.name', array('label' => false, 'size' => '70')); ?></td>
  </tr>
  <tr class="even3">
    <td><?php echo __('kind'); ?></td>
    <td><input type="radio" name="data[Ticket][kind]" id="kind_question" id="TicketKind" value="question" checked="checked" onclick="javascript:toggleLayer('severity', false);" /> Question<input type="radio" name="data[Ticket][kind]" id="kind_bug" id="TicketKind" value="bug" onclick="javascript:toggleLayer('severity', true);" /> Bug<input type="radio" name="data[Ticket][kind]" id="kind_task" id="TicketKind" value="task" onclick="javascript:toggleLayer('severity', false);" /> <?php echo __('new_functionality'); ?>
		<br/>
		<div id="severity" style="display:none;">
			<label><?php echo __('severity'); ?></label>
			<?php echo $form->radio('Ticket.severity', array('0' => __('not_blocking', true), '1' => __('blocking', true))); ?>
		</div>
	</td>
  </tr>
  <tr class="odd3">
    <td><?php echo $form->label(__('ideal_deliver_date', true)); ?></td>
    <td><?php echo $form->input('Ticket.ideal_deliver_date', array('label' => false)); ?></td>
  </tr>
  <tr class="even3">
    <td><?php echo $form->label('Description'); ?></td>
    <td><?php echo $form->input('Ticket.description', array('label' => false, 'rows'=>'10','cols'=>'70')); ?></td>
  </tr>
  <tr class="odd3">
    <td> </td>
    <td><?php echo $form->checkbox('add_doc').' Lier des documents a cette demande'; ?></td>
  </tr>
</table>

		<?php if ($allow_qualify) {
			echo $this->renderElement('tickets/info_avc');
			echo $this->renderElement('tickets/lots');
		} ?>
		<br/>
		<label></label>
		<input type="submit" value="<?php echo __('validate'); ?>">&nbsp;<?php echo $link->projectLink($project_id, $project_name, __('cancel', true), '/tickets/'); ?>
	</form>
</div>
<p></p>